/**
 * 
 */
package com.xy.frame.service;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.google.common.collect.Maps;
import com.xy.commons.PageUtil;
import com.xy.frame.dao.SysconfigMapper;

/**
 * @author admin
 * 
 */
@Service
public class SysconfigService {
	@Autowired
	SysconfigMapper sysconfigMapper;

	public Map<String, Object> queryCodeTypeList(Map<String, Object> params) {
		List<Map<String, Object>> items = sysconfigMapper.queryCodeTypeList(params);
		int count = sysconfigMapper.queryCodeTypeCount(params);
		Map<String, Object> pages = Maps.newHashMap();
		pages.put(PageUtil.ITEMS, items);
		pages.put(PageUtil.TOTALS, count);
		return pages;
	}

	public Map<String, Object> queryCodeValueList(Map<String, Object> params) {
		List<Map<String, Object>> items = sysconfigMapper.queryCodeValueList(params);
		int count = sysconfigMapper.queryCodeValueCount(params);
		Map<String, Object> pages = Maps.newHashMap();
		pages.put(PageUtil.ITEMS, items);
		pages.put(PageUtil.TOTALS, count);
		return pages;
	}
	
	public List<Map<String,Object>> loadCodeValue(){
		Map<String, Object> params = Maps.newHashMap();
		return sysconfigMapper.queryCodeValueList(params);
	}
}
